#ifndef _TEST_H_
#define _TEST_H_

#include<iostream>
#include<fstream>
#include<vector>

using namespace std;

const int not_a_reading=-3333;
const int not_a_month=-1;
const double degree_max=200;
const double degree_min=-200;

struct Day
{
  vector<double>hour{vector<double>(24,not_a_reading)};
};

struct Month
{
  int month{not_a_month};
  vector<Day> day{32};
};

struct Year
{
  int year;
  vector<Month>month{12};
};

struct Reading
{
  int day;
  int hour;
  double temperature;
};

static vector<string> month_table={"jan","feb","mar","apr","may","june","july","aug","sep","oct","nov","dec"};

istream& operator>>(istream& is,Reading& r);

istream& operator>>(istream& is,Month& m);

istream& operator>>(istream& is,Year& y);

int month_to_int(const string& month);

bool is_valid(const Reading& r);

void end_of_loop(istream& ist,const char term,const string& message);

#endif
